package cn.ljh.zard.parse;

import lombok.NonNull;

import java.io.InputStream;

/**
 * 专门解析 properties文件的解析器
 */
public class PropertieParse implements Parse {



    private final static String fileExtension = ".properties";

    @Override
    public void valid(@NonNull String filePath) throws ParseException {
    }

    @Override
    public InputStream parse(String location) {

        // 用当前线程对用的加载器去读取文件流
        InputStream inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(location + fileExtension);

        return inputStream;
    }
}
